﻿@model List<DataAccess.Models.Tags>
@{
    ViewBag.Title = "轮播图";
    Layout = "~/Views/Shared/_Layout.cshtml";
    var lb = Model.FindAll(c => c.TagType == 1).OrderBy(k => k.Sort);
    var jd = Model.FindAll(c => c.TagType == 2).OrderBy(k => k.Sort);
}


<div class="row">
    <div class="col-lg-12">
        <div class="row">
            <div class="col-lg-12">
                <div class="main-box">
                    <header class="main-box-header clearfix"><h1>首页轮播图管理</h1>
                        <div class="pull-left top-page-ui" style="margin-right:40px;">
                            <a href="/Tagadd.html" class="btn btn-primary pull-right">
                                <i class="fa fa-plus-circle fa-lg"></i> 添加轮播图
                            </a>
                        </div>
                    </header>
                    
                    <div class="main-box-body clearfix">
                     
                        

                        <div class="tabs-wrapper profile-tabs">
                            <ul class="nav nav-tabs">
                                <li class="active"><a href="#tab-newsfeed" data-toggle="tab">轮播图</a></li>
                                <li><a href="#tab-activity" data-toggle="tab">焦点图</a></li>
                            </ul>
                            <div class="tab-content">
                                <div class="tab-pane fade in active" id="tab-newsfeed">
                                    <div class="main-box-body">
                                        <div id="gallery-photos-lightbox">
                                          
                                            <ul class="clearfix gallery-photos">
                                                @foreach (var item in lb)
                                                { 
                                                 <li class="col-md-6 col-sm-3 col-xs-6" >
                                                    <div class="main-box clearfix profile-box-contact">
                                                        <div class="main-box-body clearfix">
                                                            <img src="@item.ImgUrl" width="100%" height="auto" />
                                                            <div class="profile-box-footer clearfix" style="padding-top:0px;padding-bottom:0px;">
                                                               @item.Title
                                                                <a href="/tagadd.html?id=@item.id" style="width:25%">[编辑]</a>
                                                                <a href="/tagadd.html?id=@item.id" style="width:25%">删除</a>

                                                            </div>
                                                        </div>
                                                    </div>
                                                </li>
                                                    
                                                }
                                              
                                        
                                              
                                                
                                            </ul>
                                        </div>
                                    </div>
                                </div>

                                <div class="tab-pane fade" id="tab-activity">
                                    <div id="newsfeed">
                                        <div >
                                            <div class="story-content">
                                                <div class="story-inner-content">
                                                    <div class="story-images clearfix" style="border:dashed 1px ">
                                                        @{int index = 1;}
                                                        @foreach (var item in jd)
                                                        {
                                                            if (index == 1 || index == 2) { 
                                                                <a href="/tagadd.html?id=@item.id" style="border:dashed 1px" class="story-image-link">
                                                            <img src="@item.ImgUrl" alt="" class="img-responsive" />
                                                                     </a>}
                                                            if (index == 3)
                                                            {
                                                                <a href="/tagadd.html?id=@item.id" style="border:dashed 1px" class="story-image-link story-image-link-small">
                                                                    <img src="@item.ImgUrl" alt="" class="img-responsive" />
                                                                </a>
                                                            }
                                                            if (index == 4)
                                                            {
                                                                <a href="/tagadd.html?id=@item.id" style="border:dashed 1px" class="story-image-link story-image-link-small hidden-xs">
                                                                    <img src="@item.ImgUrl" alt="" class="img-responsive" />
                                                                </a>
                                                            }

                                                            index++;
                                                        }
                                                      
                                                        
                                                      
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>


                    </div>
                    
                </div>

              


            </div>

            
        </div>
    </div>
</div>


@section Scripts{
<link rel="stylesheet" type="text/css" href="/css/libs/dropzone.css" >
<link rel="stylesheet" type="text/css" href="/css/libs/magnific-popup.css" >

    
<script src="/js/jquery-ui.custom.min.js"></script>
<script src="/js/dropzone.js" ></script>
<script src="/js/jquery.magnific-popup.min.js" ></script>
<script>
    $(function () {
        $('ul#gallery-photos').sortable({
            opacity: 0.6, cursor: 'move', update: function () {
                var order = $(this).sortable('serialize');
              
            }
        });

      
    });
</script>

    }



